tools/libxl: Use of init()/dispose() to avoid leaking libxl_dominfo.ssid_label
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 5 Jan 2015 14:19:58 +0000 (14:19 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 6 Jan 2015 11:10:43 +0000 (11:10 +0000)
commit54eb18cd63ed7243f1ab497e35807bf6f4a436ec
treef4553bced46cf186f3d3697b662e712533742c70
parent7ca2558c048c7d5d2a6d401e58181a06a00f9eeb
tools/libxl: Use of init()/dispose() to avoid leaking libxl_dominfo.ssid_label

libxl_dominfo contains a ssid_label pointer which will have memory allocated
for it in libxl_domain_info() if the hypervisor has CONFIG_XSM compiled.
However, the lack of appropriate use of libxl_dominfo_{init,dispose}() will
cause the label string to be leaked, even in success cases.

This was discovered by XenServers Coverity scanning, and are issues not
identified by upstream Coverity Scan.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_dom.c